package com.whc.config;

import com.whc.utils.SnowflakeIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 韦红材
 * @ClassName SnowflakeConfig
 * @data 2025/01/05 13:33
 * @Version V1.0
 **/
@Configuration
@Slf4j
public class SnowflakeConfig {

    @Bean
    public SnowflakeIdGenerator snowflakeIdGenerator() {
        // 使用默认的dataCenterId和machineId，实际场景可以从配置中读取
        log.info("加载雪花id配置类");
        return new SnowflakeIdGenerator(0L, 0L);
    }
}
